﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DocumentCategoryItem>" %>

<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Lib.Common" %>
<%@ Import Namespace="SDT.Model" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Tải file | Văn bản pháp luật trong lĩnh vực bất động sản
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="sr_alnk">
        <span class="breadcrumbs pathway"><a href="/" class="pathway">Trang chủ</a>
            <img src="/Images/ftc/arrow.png" alt="" />
            <a href="/Document" class="pathway">Tài liệu</a>
            <% if (Model.Category != null)
               { %>
            <img src="/Images/ftc/arrow.png" alt="" />
            <%= Model.Category.Name %></span>
        <%} %>
    </div>
    <div class="col_q_l" id="col_r">
        <% if (Model.Category != null)
           { %>
        <div class="dm_cat">
            <div class="dm_name">
                <%= Model.Category.Name %>
            </div>
        </div>
        <div class="clr">
        </div>
        <div id="dm_docs">
            <% if (Model.DocumentItems != null && Model.DocumentItems.Count() > 0)
               {
                   foreach (DocumentItem fd in Model.DocumentItems)
                   {
            %>
            <div>
                <a class="dm_name" href="/Document/Detail/<%= fd.FormDocument.ID %>">
                    <%= fd.FormDocument.FormName %></a> <span class="dm_date"></span><span class="dm_counter">
                        Ngày đăng:
                        <%= fd.FormDocument.AddDate.HasValue? fd.FormDocument.AddDate.Value.ToString("dd/MM/yyyy") : "" %></span>
            </div>
            <div class="dm_description">
                <p>
                    <%= fd.FormDocument.FormNote %></p>
            </div>
            <div class="clear">
            </div>
            <div style="margin-left: 40px; padding: 6px 0px 6px 10px;">
                <ul>
                    <% if (fd.Documents != null && fd.Documents.Count() > 0)
                       {
                           foreach (Document doc in fd.Documents)
                           {
                    %>
                    <li style="list-style-type: none;">
                        <img src="<%= doc.Path.IsDocument("doc") ? "/Images/doc.png" : "/Images/pdf_16x16.png"%>"
                            alt="file icon">&nbsp;&nbsp; <a href="<%= Model.FileRootPath+ doc.ID+"/" + doc.Path %>"
                                onclick="UpdateDowdload('<%= doc.ID %>')">
                                <%= doc.Name%></a> ( Tải xuống:
                        <%= doc.nDownload %>
                        ) </li>
                    <%}
                       }%>
                </ul>
            </div>
            <div class="clear">
            </div>
            <div class="dm_separator">
            </div>
            <div class="clear">
            </div>
            <%}
               } %>
        </div>

        <script src="../../Scripts/AjaxCommons.js" type="text/javascript"></script>
        <script type="text/javascript">
            function UpdateDowdload(id) {
                ApplyChangeYN("/AjaxData/UpdateDownload/" + id);
            }
        </script>

        <div class="pager">
            <%= Html.Pager(Model.Documents.PageSize, Model.Documents.PageNumber, Model.Documents.TotalItemCount)%>
        </div>
        <div id="dm_nav">
            <div>
            </div>
        </div>
        <div class="clear">
        </div>
        <%} %>
    </div>
    <div class="col_q_r">
        <div class="bannergroup">
            <img src="../../Images/ftc/banner-2.jpg" width="295" class="bor_img" />
        </div>
        <div class="bannergroup">
            <img src="../../Images/ftc/banner-.gif" width="295" class="bor_img" />
        </div>
        <div class="bannergroup">
            <img src="../../Images/ftc/banner-1.gif" width="295" class="bor_img" />
        </div>
    </div>
</asp:Content>
